import os

from dotenv import load_dotenv
from langchain import PromptTemplate
from langchain.llms import Tongyi

load_dotenv("../ai.env")

api_key = os.getenv("DASHSCOPE_API_KEY")
llm = Tongyi(
    model_name="qwen-max",
    temperature=0,
    dashscope_api_key=api_key
)
prompt = PromptTemplate.from_template(
    "你是一个起名大师，请模仿示例起3个{county}名字，比如男孩经常叫做{boy}，女孩经常叫做{girl}")
message = prompt.format(county="中国特色的", boy="狗蛋", girl="翠花")
print(message)
response = llm.predict(message)
print(response)
